#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    char win = '0';
    for (int j = 0; j < s.size(); j++) {
      if (s[i] > win)
        win = s[i];
    }
    __________;
  }
  return 0;
}